<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .hide{

        }
        .dialog{
            position: fixed;
            left: 0px;
            top: 0;
            width: 100%;
            height: 100%;
            z-index: 999;
            background-color: rgba(0,0,0,0.5);

        }

        .dialog.dialog-body{
            width: 360px;
            min-height: 200px;
            background-color: white;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
            border-radius: 11px;
            box-shadow:  0 0 20px rgba(0,0,0,0.5);
            overflow: hidden;
            box-sizing: border-box;
        }
.dialog.dialog-body title{
    line-height: 30px;
    text-align: center;
    color: white;
    background-color: #00d7c6;

}.dialog.dialog-body title:last-child{
            float: right;
            margin-right:20px ;
 }
        .dialog .dialog-body .content{

        }
    </style>
</head>
<body>
<p>哈哈哈哈哈哈哈哈哈</p>
<p>哈哈哈哈哈哈哈哈哈</p>
<p>哈哈哈哈哈哈哈哈哈</p>
<button type="button" onclick="showDialog()">弹框</button>
<div class="dialog hide" id="box1">
    <div class="dialog-body">
        <div class="title">
            <span>酷炫的弹框</span>
            <span>X</span>
        </div>
        <div class="content">
            <p>哈哈</p>
        </div>
    </div>


</div>

</body>
<script type="text/javascript" src="../lib/jquery.min.js"></script>
<script type="text/javascript">
    function showDialog() {
       $("#box1").removeClass("hide");
    }
</script>



</html>